package com.hd.common.exception;

import com.hd.common.constant.SysConstant;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @Project 交通运输第三方监测平台
 * @Version: 1.0
 * @Author chentl
 * @Description: 自定义异常
 * @Pacakges:
 * @Create: 2020/12/2 0002 9:35
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class SupException extends RuntimeException {
    private static final long serialVersionUID = 1L;

    private String msg;
    private int code = SysConstant.SC_INTERNAL_SERVER_ERROR;

    public SupException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public SupException(String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
    }

    public SupException(String msg, int code) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    public SupException(String msg, int code, Throwable e) {
        super(msg, e);
        this.msg = msg;
        this.code = code;
    }

}
